unit REnvioNCV;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, RLPreviewForm, RLReport ;

type
  TFormREnvioNCV = class(TForm)
    RLReport1: TRLReport;
    RLBand1: TRLBand;
    RLLabel1: TRLLabel;
    RLLabel2: TRLLabel;
    RLDBText1: TRLDBText;
    RLMemo1: TRLMemo;
    RLLabel4: TRLLabel;
    RLLabel5: TRLLabel;
    RLDBText2: TRLDBText;
    RLDBText3: TRLDBText;
    RLMemo2: TRLMemo;
    RLBand2: TRLBand;
    RLDBText4: TRLDBText;
    RLDBText5: TRLDBText;
    RLDBText6: TRLDBText;
    RLLabel6: TRLLabel;
    RLLabel7: TRLLabel;
    RLLabel3: TRLLabel;
    RLLabel8: TRLLabel;
    RLDBText7: TRLDBText;
    RLDBText8: TRLDBText;
    RLLabel9: TRLLabel;
    RLLabel10: TRLLabel;
    RLLabel12: TRLLabel;
    RLDBText9: TRLDBText;
    procedure RLLabel2BeforePrint(Sender: TObject; var Text: String;
      var PrintIt: Boolean);
    procedure RLDBText1BeforePrint(Sender: TObject; var Text: String;
      var PrintIt: Boolean);
    procedure RLLabel1BeforePrint(Sender: TObject; var Text: String;
      var PrintIt: Boolean);
    procedure RLMemo1BeforePrint(Sender: TObject; var Text: String;
      var PrintIt: Boolean);
    procedure RLLabel10BeforePrint(Sender: TObject; var Text: String;
      var PrintIt: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormREnvioNCV: TFormREnvioNCV;

implementation

uses DateUtils, DMR, DMS;

{$R *.dfm}

procedure TFormREnvioNCV.RLLabel2BeforePrint(Sender: TObject;
  var Text: String; var PrintIt: Boolean);
begin
    if (TimeToStr(now) > '12:00:00') and (TimeToStr(now) < '18:00:00') then
        Text := 'Boa tarde'
    else if (TimeToStr(now) > '18:00:00') and (TimeToStr(now) < '24:00:00') then
        Text := 'Boa noite'
    else if (TimeToStr(now) > '06:00:00') and (TimeToStr(now) < '12:00:00') then
        Text := 'Bom dia';
    Text := UpperCase(Text);
end;

procedure TFormREnvioNCV.RLDBText1BeforePrint(Sender: TObject;
  var Text: String; var PrintIt: Boolean);
begin
    Text := text +', NA CIDADE  '+ DMRel.dsRelat.DataSet.FieldbyName('CIDADEUF').AsString;
end;

procedure TFormREnvioNCV.RLLabel1BeforePrint(Sender: TObject;
  var Text: String; var PrintIt: Boolean);
begin
    Text := UpperCase(Text);
end;

procedure TFormREnvioNCV.RLMemo1BeforePrint(Sender: TObject;
  var Text: String; var PrintIt: Boolean);
begin
    Text := UpperCase(Text);
end;

procedure TFormREnvioNCV.RLLabel10BeforePrint(Sender: TObject;
  var Text: String; var PrintIt: Boolean);
begin
    Text := datetimetostr(now);
end;

end.
